// pages/deduction/deduction.js
// import * as echarts from '../../ec-canvas/echarts';
import {
  request
} from '../../request/index.js'

Page({

  /**
   * 页面的初始数据
   */
  data: {
    user: {},
    deductionList: [],

 
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad:function(options){
      let user =  wx.getStorageSync('user') ;
    console.log(user);
    this.setData({
      user,
    });
    request({
          url: 'Order/getOrderListByUserId',
          data: {
            user_id: this.data.user.user_id
          }
        }).then(result=>{
          console.log(result);
              this.setData({
                deductionList: result.data.data.reverse()
              });
        })
  }
})